package com.example.campuslink.commen.db.school

import androidx.annotation.NonNull
import androidx.room.Entity
import androidx.room.Ignore
import androidx.room.PrimaryKey
import androidx.room.TypeConverters
import com.example.campuslink.commen.db.InvitationTableConverter
import com.example.campuslink.commen.db.MessageBeanConverter
import com.example.campuslink.commen.db.SearchDataConverter
import com.example.campuslink.commen.db.invitation.InvitationTable
import com.example.campuslink.commen.db.message.MessageTable
import com.example.campuslink.commen.db.userNumber.ListMessageTableConverter
import com.example.campuslink.model.SearchWordData
import db.ListStringConverter

@Entity(tableName = "school_info_table")
@TypeConverters(
    ListStringConverter::class,
    InvitationTableConverter::class,
    SearchDataConverter::class,
    ListMessageTableConverter::class
)
data class SchoolInfoTable(
    @PrimaryKey(autoGenerate = true)
    var id: Int = 0,
    @NonNull
    var schoolName: String = "",
    @NonNull
    var province: String = "",
    @NonNull
    var schoolImage: String = "",
    @TypeConverters(ListStringConverter::class)
    var schoolIntroduce: MutableList<String> = mutableListOf(),
    @TypeConverters(ListStringConverter::class)
    var schoolUser: MutableList<String> = mutableListOf(),
    @TypeConverters(InvitationTableConverter::class)
    var mainInvitationList: MutableList<InvitationTable> = mutableListOf(),
    @TypeConverters(InvitationTableConverter::class)
    var shoppingInvitationList: MutableList<InvitationTable> = mutableListOf(),
    @TypeConverters(SearchDataConverter::class)
    var searchData: MutableList<SearchWordData> = mutableListOf(),
    @TypeConverters(ListMessageTableConverter::class)
    var messageList: MutableList<MessageTable> = mutableListOf()
) {
    @Ignore
    constructor() : this(
        id = 0,
        schoolName = "",
        province = "",
        schoolImage = "",
        schoolIntroduce = mutableListOf(),
        schoolUser = mutableListOf(),
        mainInvitationList = mutableListOf(),
        shoppingInvitationList = mutableListOf(),
        searchData = mutableListOf(),
        messageList = mutableListOf()
    )
}
